#pragma once
#include "ElementNode.h"
#include "math.h"
#include "grid3x3.h"
namespace NBGUI
{
	class GUIAPI CheckBox: public ElementNode, public Grid3x3
	{
	public:
		enum CheckState
		{
			Checked = 0,
			UnChecked,

			StateNum
		};

		CheckBox(GUIDrawer* drawer, const char* name, const char* eleText, int eleType = NONE, Rect& _rect = Rect() );
		CheckBox(GUIDrawer* drawer, const char* name, const char* eleText, vec2f* uv, int eleType = NONE, Rect& _rect = Rect() );
		~CheckBox();

		void buildVI(std::vector<Vertex>* vertices, std::vector<unsigned int>* indices,unsigned int screenWidth, unsigned int screenHeight);

		void draw();
		void handleEvent(Event* e);
	protected:
		vec2f uv[8];//check and un-check
		int state;
	};
}